home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 5.6 KB | 214 lines | [TEXT/MPS ] |
- // USectionMgr.h
- // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
-
-
- #ifndef __USECTIONMGR__
- #define __USECTIONMGR__
-
- // MacApp
-
- #ifndef __UBEHAVIOR__
- #include "UBehavior.h"
- #endif
-
- #ifndef __UCOMMAND__
- #include "UCommand.h"
- #endif
-
- // Toolbox
-
- //----------------------------------------------------------------------------------------
- // External and forward class declarations.
- //----------------------------------------------------------------------------------------
-
- class TDocument;
- class TPublisher;
- class TSection;
- class TSectionList;
- class TSubscriber;
-
-
- //----------------------------------------------------------------------------------------
- // Constants
- //----------------------------------------------------------------------------------------
-
- const IDType kSectionMgrBehaviorID = 'smgr'; // behavior id for section mgr
-
- //----------------------------------------------------------------------------------------
- // TSectionMgr: This object is responsible for interaction with the Edition manager
- //----------------------------------------------------------------------------------------
-
- class TSectionMgr : public TBehavior
- {
- MA_DECLARE_CLASS;
-
- public:
-
- TSectionList* fSectionList;
-
- TSectionMgr();
- // Empty constructor to satisfy compiler.
-
- void ISectionMgr();
- // initialize
-
- virtual ~TSectionMgr();
- // frees this object
-
- virtual void DoAESectionEvent(CommandNumber aCommandNumber,
- const AppleEvent& message,
- const AppleEvent& reply);
- // responds to the edition manager apple events
-
- };
-
-
- //----------------------------------------------------------------------------------------
- // TSectionCommand: an abstract superclass used as the base class for the edition manager
- // apple event command classes
- //----------------------------------------------------------------------------------------
-
- class TSectionCommand : public TServerCommand
- {
- MA_DECLARE_CLASS;
-
- public:
- TSection* fSection; // section object for this apple event
- // command
-
- TSectionCommand();
- // Empty constructor to satisfy compiler.
- virtual ~TSectionCommand();
- // Destructor
-
- void ISectionCommand(CommandNumber itsCommandNumber,
- TDocument* itsDocument,
- TSection* itsSection);
- // initialize this command
-
- void ISectionCommand(CommandNumber itsCommandNumber,
- const AppleEvent& itsMessage,
- const AppleEvent& itsReply);
- // initialize this command from the AppleEvent stream
- };
-
-
- //----------------------------------------------------------------------------------------
- // TSectionReadEventCommand
- //----------------------------------------------------------------------------------------
-
- class TSectionReadEventCommand : public TSectionCommand
- {
- MA_DECLARE_CLASS;
-
- public:
-
- TSectionReadEventCommand();
- // Empty constructor to satisfy compiler.
- virtual ~TSectionReadEventCommand();
- // Destructor
-
- void ISectionReadEventCommand(CommandNumber itsCommandNumber,
- TDocument* itsDocument,
- TSubscriber* itsSubscriber);
- // initialize this command
-
- virtual void DoIt();
- // call ((TSubscriber)fSection)->Subscribe
- };
-
-
- //----------------------------------------------------------------------------------------
- // TSectionWriteEventCommand
- //----------------------------------------------------------------------------------------
-
- class TSectionWriteEventCommand : public TSectionCommand
- {
- MA_DECLARE_CLASS;
-
- public:
-
- TSectionWriteEventCommand();
- // Empty constructor to satisfy compiler.
- virtual ~TSectionWriteEventCommand();
- // Destructor
-
- void ISectionWriteEventCommand(CommandNumber itsCommandNumber,
- TDocument* itsDocument,
- TPublisher* itsPublisher);
- // initialize this command
-
- virtual void DoIt();
- // call ((TPublisher)fSection))->Publish
- };
-
-
- //----------------------------------------------------------------------------------------
- // TSectionScrollEventCommand
- //----------------------------------------------------------------------------------------
-
- class TSectionScrollEventCommand : public TSectionCommand
- {
- MA_DECLARE_CLASS;
-
- public:
-
-
- TSectionScrollEventCommand();
- // Empty constructor to satisfy compiler.
- virtual ~TSectionScrollEventCommand();
- // Destructor
-
- void ISectionScrollEventCommand(CommandNumber itsCommandNumber,
- TDocument* itsDocument,
- TSection* itsSection);
- // initialize this command
-
- virtual void DoIt();
- // scrolls the document to the publisher
- };
-
-
- //----------------------------------------------------------------------------------------
- // TSectionCancelEventCommand
- //----------------------------------------------------------------------------------------
-
- class TSectionCancelEventCommand : public TSectionCommand
- {
- MA_DECLARE_CLASS;
-
- public:
-
- TSectionCancelEventCommand();
- // Empty constructor to satisfy compiler.
- virtual ~TSectionCancelEventCommand();
- // Destructor
-
- void ISectionCancelEventCommand(CommandNumber itsCommandNumber,
- TDocument* itsDocument,
- TSection* itsSection);
- // initialize this command
-
- virtual void DoIt();
- // cancels this section
-
- virtual void UndoIt();
- // un-cancels this section
-
- // virtual void Commit();
- // // Actually cancel the section by unregistering it
-
- };
-
-
- //----------------------------------------------------------------------------------------
- // Global function declarations
- //----------------------------------------------------------------------------------------
-
- extern void InitUSectionMgr();
- // Initialize the section manager and attach it to the application. Note that the
- // application should already have been instantiated and initialized when this
- // procedure is called.
-
- #endif // __USECTIONMGR__
-